﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using BYGamesBLL;
using BYGamesDLL;
using System.Configuration;

namespace BYGames
{
    public partial class Login : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {

        }

        protected void Button1_Click(object sender, EventArgs e)
        {
            String conexao = ConfigurationManager.ConnectionStrings["bygamesConnectionString"].ConnectionString;
            ClienteDAO clienteDAO = ClienteDAO.GetInstance(conexao);
            Cliente cliente = new Cliente();
            cliente = clienteDAO.Login(txtEmail.Text, txtSenha.Text);
            Session["Cliente"] = cliente;
            Session["CPF"] = cliente.Cpf;
            Response.Redirect("~/Default.aspx");
        }
    }
}